<html>
 <head>
  <meta charset="UTF-8">
 </head>
 <body>
  <h1 data-lake-id="boFlI" id="boFlI"><span data-lake-id="ubee67a0a" id="ubee67a0a">典型回答</span></h1>
  <p data-lake-id="ub3af33f7" id="ub3af33f7"><br></p>
  <p data-lake-id="udfd9ceec" id="udfd9ceec"><span data-lake-id="uad1a2582" id="uad1a2582">Redisson和Jedis是两个流行的Java客户端库，用于与Redis进行交互，其实在Redisson的官网上针对这两个产品做了比较全面的对比：</span><a href="https://redisson.org/feature-comparison-redisson-vs-jedis.html" target="_blank" data-lake-id="u69356770" id="u69356770"><span data-lake-id="uabc6ad70" id="uabc6ad70">https://redisson.org/feature-comparison-redisson-vs-jedis.html</span></a></p>
  <p data-lake-id="u26577f8d" id="u26577f8d"><br></p>
  <p data-lake-id="u6e4d0e64" id="u6e4d0e64"><span data-lake-id="u2dccd42c" id="u2dccd42c">一句话就是Jedis非常的轻量级，极其简单，可以认为就是把Redis的命令做了一下封装，而Redisson提供了更多高级特性和功能，整体也更加复杂一些。</span></p>
  <p data-lake-id="u73649f58" id="u73649f58"><br></p>
  <p data-lake-id="u850afb1a" id="u850afb1a"><span data-lake-id="u76104a0b" id="u76104a0b">以下是我基于官网上的资料做的简单整理：</span></p>
  <p data-lake-id="u47178cdc" id="u47178cdc"><span data-lake-id="ud0efb0c6" id="ud0efb0c6">​</span><br></p>
  <ol list="u4345668d">
   <li fid="u90e06bde" data-lake-id="u29ac4304" id="u29ac4304" data-lake-index-type="true"><span data-lake-id="ufc9abd7d" id="ufc9abd7d">分布式集合</span><span data-lake-id="uaac390f5" id="uaac390f5">：</span></li>
  </ol>
  <ul list="uea099b64" data-lake-indent="1">
   <li fid="u6c50dad2" data-lake-id="u1ba77a80" id="u1ba77a80" data-lake-index-type="true"><span data-lake-id="u57ba83a0" id="u57ba83a0">Redisson：提供多种Java集合对象的实现，包括Multimap、PriorityQueue、DelayedQueue等</span></li>
   <li fid="u6c50dad2" data-lake-id="u8be3c097" id="u8be3c097" data-lake-index-type="true"><span data-lake-id="u17dfe17e" id="u17dfe17e">Jedis：支持较少的分布式集合，大多只支持Map、Set、List等的基本命令。</span></li>
  </ul>
  <ol list="u4345668d" start="2">
   <li fid="u90e06bde" data-lake-id="u22297e6a" id="u22297e6a" data-lake-index-type="true"><span data-lake-id="u27d49680" id="u27d49680">分布式锁和同步器</span><span data-lake-id="u82d7ac76" id="u82d7ac76">：</span></li>
  </ol>
  <ul list="u8a1482e5" data-lake-indent="1">
   <li fid="u3173209e" data-lake-id="u2ea390ee" id="u2ea390ee" data-lake-index-type="true"><span data-lake-id="u03992e9c" id="u03992e9c">Redisson：支持常见的Java锁和同步器，如FairLock、MultiLock、Semaphore、CountDownLatch等。</span></li>
   <li fid="u3173209e" data-lake-id="u16c2f447" id="u16c2f447" data-lake-index-type="true"><span data-lake-id="u5df2fdaf" id="u5df2fdaf">Jedis：不支持。需要自己实现</span></li>
  </ul>
  <ol list="u4345668d" start="3">
   <li fid="u90e06bde" data-lake-id="u938625ee" id="u938625ee" data-lake-index-type="true"><span data-lake-id="u93ff262b" id="u93ff262b">分布式对象：</span></li>
  </ol>
  <ul list="u4a6212bb" data-lake-indent="1">
   <li fid="u2738b7a1" data-lake-id="u9bc03348" id="u9bc03348" data-lake-index-type="true"><span data-lake-id="u91a72851" id="u91a72851">Redisson：实现了多种分布式对象，如Publish/Subscribe、BloomFilter、RateLimiter、Id Generator等。</span></li>
   <li fid="u2738b7a1" data-lake-id="u72b52bf8" id="u72b52bf8" data-lake-index-type="true"><span data-lake-id="u91c1fd0c" id="u91c1fd0c">Jedis：只支持基本的类型的基本命令，如AtomicLong、AtomicDouble、HyperLogLog等</span></li>
  </ul>
  <ol list="u4345668d" start="4">
   <li fid="u90e06bde" data-lake-id="u8bc3b8ef" id="u8bc3b8ef" data-lake-index-type="true"><span data-lake-id="u3b977b38" id="u3b977b38">高级缓存支持</span><span data-lake-id="uea8088aa" id="uea8088aa">：</span></li>
  </ol>
  <ul list="uf3bf70d2" data-lake-indent="1">
   <li fid="u063470f4" data-lake-id="u17428c28" id="u17428c28" data-lake-index-type="true"><span data-lake-id="u4ced0349" id="u4ced0349">Redisson：提供多种高级缓存功能，支持Read-through/Write-through/Write-behind等策略。</span></li>
   <li fid="u063470f4" data-lake-id="uc94406c3" id="uc94406c3" data-lake-index-type="true"><span data-lake-id="uf82267e8" id="uf82267e8">Jedis：不支持这些高级缓存功能。</span></li>
  </ul>
  <ol list="u4345668d" start="5">
   <li fid="u90e06bde" data-lake-id="u5199eb86" id="u5199eb86" data-lake-index-type="true"><span data-lake-id="ud2d3adcf" id="ud2d3adcf">API架构</span><span data-lake-id="ucc830532" id="ucc830532">：</span></li>
  </ol>
  <ul list="ud56a18e1" data-lake-indent="1">
   <li fid="uec9caae7" data-lake-id="u24dfb254" id="u24dfb254" data-lake-index-type="true"><span data-lake-id="u934361dd" id="u934361dd">Redisson</span><span data-lake-id="u4d327580" id="u4d327580">：支持实例线程安全、异步接口、响应式流接口和RxJava3接口。</span></li>
   <li fid="uec9caae7" data-lake-id="u3d7bccf7" id="u3d7bccf7" data-lake-index-type="true"><span data-lake-id="u175ba4c6" id="u175ba4c6">Jedis：不支持。</span></li>
  </ul>
  <ol list="u4345668d" start="6">
   <li fid="u90e06bde" data-lake-id="ue7c027d8" id="ue7c027d8" data-lake-index-type="true"><span data-lake-id="u1ec06905" id="u1ec06905">分布式服务</span><span data-lake-id="u4eae8560" id="u4eae8560">：</span></li>
  </ol>
  <ul list="ub75467ab" data-lake-indent="1">
   <li fid="ubc0afecf" data-lake-id="u0c198f57" id="u0c198f57" data-lake-index-type="true"><span data-lake-id="u8d323bf0" id="u8d323bf0">Redisson</span><span data-lake-id="u02fcef1e" id="u02fcef1e">：提供ExecutorService、MapReduce、SchedulerService等服务。</span></li>
   <li fid="ubc0afecf" data-lake-id="ude2a1662" id="ude2a1662" data-lake-index-type="true"><span data-lake-id="u48cf1464" id="u48cf1464">Jedis</span><span data-lake-id="uc899444e" id="uc899444e">：不支持这些分布式服务</span><span data-lake-id="ue2f7cad0" id="ue2f7cad0">。</span></li>
  </ul>
  <ol list="u4345668d" start="7">
   <li fid="u90e06bde" data-lake-id="ue51fd3e4" id="ue51fd3e4" data-lake-index-type="true"><span data-lake-id="u07fb1a2a" id="u07fb1a2a">框架集成</span><span data-lake-id="u7e00a02b" id="u7e00a02b">：</span></li>
  </ol>
  <ul list="u61d1b52a" data-lake-indent="1">
   <li fid="u66078e00" data-lake-id="ud33a3058" id="ud33a3058" data-lake-index-type="true"><span data-lake-id="ue83067fa" id="ue83067fa">Redisson</span><span data-lake-id="ufc11f832" id="ufc11f832">：支持Spring Cache、Hibernate Cache、MyBatis Cache等。</span></li>
   <li fid="u66078e00" data-lake-id="ubd25a443" id="ubd25a443" data-lake-index-type="true"><span data-lake-id="u633bfeef" id="u633bfeef">Jedis</span><span data-lake-id="u27afcfab" id="u27afcfab">：仅支持Spring Session和Spring Cache</span><span data-lake-id="u35534dfe" id="u35534dfe">。</span></li>
  </ul>
  <ol list="u4345668d" start="8">
   <li fid="u90e06bde" data-lake-id="u48bc68eb" id="u48bc68eb" data-lake-index-type="true"><span data-lake-id="ue9fda971" id="ue9fda971">安全性</span><span data-lake-id="ud9a403be" id="ud9a403be">：</span></li>
  </ol>
  <ul list="u86a89487" data-lake-indent="1">
   <li fid="u2051c4fd" data-lake-id="u61daeb3d" id="u61daeb3d" data-lake-index-type="true"><span data-lake-id="u4be085a9" id="u4be085a9">Redisson和Jedis</span><span data-lake-id="u07dd4e25" id="u07dd4e25">：都支持认证和SSL</span><span data-lake-id="u832389ad" id="u832389ad">。</span></li>
  </ul>
  <ol list="u4345668d" start="9">
   <li fid="u90e06bde" data-lake-id="ua634d583" id="ua634d583" data-lake-index-type="true"><span data-lake-id="ue6c793f7" id="ue6c793f7">自定义数据序列化</span><span data-lake-id="u8cb4c7f4" id="u8cb4c7f4">：</span></li>
  </ol>
  <ul list="uc3665fcd" data-lake-indent="1">
   <li fid="u5ff84981" data-lake-id="u419e9c41" id="u419e9c41" data-lake-index-type="true"><span data-lake-id="ud1c0db56" id="ud1c0db56">Redisson</span><span data-lake-id="u5a9c40f5" id="u5a9c40f5">：支持多种编解码器，如JSON、JDK序列化、Avro等。</span></li>
   <li fid="u5ff84981" data-lake-id="u34fc8c2e" id="u34fc8c2e" data-lake-index-type="true"><span data-lake-id="u82c1f1c3" id="u82c1f1c3">Jedis</span><span data-lake-id="uf9af0d77" id="uf9af0d77">：不支持JDK序列化或上述编解码器</span><span data-lake-id="u894c439b" id="u894c439b">。</span></li>
  </ul>
  <p data-lake-id="ua6a8b537" id="ua6a8b537"><br></p>
  <p data-lake-id="ue9cccbe6" id="ue9cccbe6"><span data-lake-id="ub0cf150d" id="ub0cf150d">所以我们在选择的时候，</span><strong><span data-lake-id="u5b158a4a" id="u5b158a4a">如果需要高级特性如分布式锁、高级缓存支持或特定框架集成，Redisson可能是更好的选择。如果项目需要一个轻量级的解决方案，且不需要高级功能，Jedis可能是合适的选择。</span></strong></p>
 </body>
</html>